<?php
namespace app\api\controller\v1;


use app\common\exception\UploadException;
use app\common\library\Upload;

class Common extends Base
{
    protected $noNeedLogin = [];
    public function upsignfile(){

        //默认普通上传文件
        $file = $this->request->file('file');
        try {
            $upload = new Upload($file);
            $attachment = $upload->upload(null,2);
            $this->success("上传成功",fiximgurl($attachment->url));
        } catch (UploadException $e) {
            $this->error($e->getMessage());
        }

    }

}
